/** An example of a Role which uses an action. Actions can be used for many things, including animations. */ class MyRole : ActionRole { // Grow for 2 seconds, then shrink back in 2 seconds. override fun createAction() : Action { return ( Scale( actor, 2, 1.5 ) then Scale( actor, 2, 1.0 ) ).forever() } override fun begin() { // If your Role needs to use the begin() method, then you MUST call super... super.begin() // Now perform your own initialisation } override fun tick() { // If you Role also need to perform addition actions each frame, then you MUST call super... super.tick() // Now include your own per-frame code... } }